home *** CD-ROM | disk | FTP | other *** search
- // VDOS.H
- // (C) Anubis Software, Agosto 1995
-
-
- #ifndef VDOS.H
- #define VDOS.H
- // Esta librería lo que pretende es poder hacer de forma rápida la
- // Selección de un fichero.
- // ----------------------------------------------------+
- // Inclusión de librerías Borland C++ |
- // ----------------------------------------------------+
- #include <dos.h>
- #include <stdlib.h>
-
-
- // ----------------------------------------------------+
- // Inclusión de librerías Anubis Software |
- // ----------------------------------------------------+
- #include "mdefs.h"
- #include "ventana2.h"
- #include "tecexec.h"
- #include "textmode.h"
-
- // ----------------------------------------------------+
- // Declaracion de variables globales |
- // ----------------------------------------------------+
- Ventana2 VDosVent;
- void interrupt (*VDosOldInterrupt)();
- BYTE mal,mbl;
- BYTE VCursorX,VCursorY;
-
- void interrupt VDosInterrupt() {
-
- asm cli
-
- asm mov mal,al
- asm mov mbl,bl
-
- asm cmp ah,02h
- asm je Nueva1002
- asm cmp ah,03h
- asm je Nueva1003
- asm cmp ah,0ah
- asm je Nueva10Fin
- asm cmp ah,0eh
- asm jz Nueva10Fin
- asm cmp ah,13h
- asm je Nueva1013
- asm cmp ah,09h
- asm je Nueva1009
- asm cmp ah,01h
- asm je final
- VDosOldInterrupt();
- asm jmp final
-
- // Definir la posición del cursor, evidentemente en la ventana
- Nueva1002:;
- asm mov VCursorX,dl
- asm mov VCursorY,dh
- // VDosVent.CursorX=_DL;
- // VDosVent.CursorY=_DH;
- // VentanaControlaCursor();
- if(VCursorY > VDosVent.Alto-2) VCursorY = VDosVent.Alto-3;
-
- // VentanaGotoXY(&VDosVent,VCursorX,VCursorY);
- // Gotoxy(VCursorX,VCursorY);
- asm jmp final
-
- // Buscar la posición del cursor, evidentemente en la ventana
- Nueva1003:;
- _DH=VDosVent.CursorY;
- _DL=VDosVent.CursorX;
- asm pop bp
- asm pop di
- asm pop si
- asm pop ds
- asm pop es
- asm pop cx // Como el resultado viene en dx debe ser asi.
- asm pop cx
- asm pop bx
- asm pop ax
- asm sti
- asm iret
-
- Nueva1009:;
- // EscribeCAV(&VDosVent,'a',VDosVent.PosX + VDosVent.CursorX,VDosVent.PosY + VDosVent.CursorY,0x33);
- VentanaPutch(&VDosVent,_AL);
- asm jmp final
-
-
- Nueva10Fin:;
- VentanaPutch(&VDosVent,_AL);
- asm jmp final
- Nueva1013:;
- final:;
- asm sti
- }// end VDosInterrupt
-
-
-
-
-
-
-
-
-
- void VDos(unsigned char car)
- {
- static char buffer[300];
- static int puntbuffer =0;
- if(car == 13) {
- // Caso en el que se manda un comando, en cierto modo bueno.
- // Sólo acepta que se escriba en la pantalla porque luego la
- // reestablece. Si el programa que se ejecuta usa raton,...
- // El cuelgue será precioso, sin poder evitarlo.
- VentanaPutch(&VDosVent,'\n');
- if(!cadenas_son_iguales(buffer,"")) {
- // EmulacionPantalla(&VDosVent);
- system(buffer);
- VPintarTodo();
- VControlaCursor();
- } else {
- // Caso en el que se pasa al dosshell de forma automática.
- // Es el caso más potente, pero con ciertas dificultades técnicas.
- // En realidad se crea un completo shell del DOS.
- ide_mouse();
- MouseOff(); //Se apaga el ratón
- setvect(0x10, VDosOldInterrupt); // Se devuelve la int 0x10 a su estado
- Borrar_Pantalla(); // Se borra la pantalla
- Gotoxy(0,0); // Se establece la posición del cursor
- system(""); // Se invoca a la creación del nuevo shell
- VPintarTodo(); // Se recuperan los estados anteriores
- InitMouse(0xFF); // Cuando vuelve el sistema se vuelven a recuperar
- show_mouse();
- setvect(0x10, VDosInterrupt); // Todos los estados anteriores
- VControlaCursor();
- }// end if
- VentanaPutch(&VDosVent,'\n');
- VentanaPuts(&VDosVent,">");
- puntbuffer=0;
- buffer[puntbuffer]=0;
- } else if (car == 8) {
- if(puntbuffer) {
- buffer[--puntbuffer]=0;
- VentanaPutch(&VDosVent, car);
- }// end if
- } else {
- VentanaPutch(&VDosVent, car);
- buffer[puntbuffer++]=car;
- buffer[puntbuffer]=0;
- }// endif
- }// end VDos
-
-
- void far TratarVDosTeclado(void)
- {
- if( TopeVentanas == &VDosVent)
- VDos(BTAscii(EventTecla));
- }// end TrataDos
-
- void VDosInicializar(void)
- {
- copiar_cadena(VDosVent.Nombre, "DOS");
- VentanaCoordenadas( &VDosVent, 0,1,80,24);
- VentanaDefine( &VDosVent, V_PRESENTACION);
- VDosVent.Caracteristicas |= MODIFICAR;
- VDosVent.ColorTexto = TBLANCO;
- VDosVent.ColorFondo = FCYAN;
- VentanaTipoCursor(&VDosVent, CURSOR_NORMAL);
- VentanaGotoXY(&VDosVent,0,0);
- VDosOldInterrupt = getvect(0x10);
- setvect(0x10,VDosInterrupt);
- EventEmpilaKeyboardRutina(TratarVDosTeclado);
- VentanaPutch(&VDosVent,'>');
- }
-
- void VDosFinalizar(void)
- {
- setvect(0x10, VDosOldInterrupt);
- }// end VDosFinalizar
-
- #endif
-